package com.ordersystem.domain;

import lombok.Data;

/**
 * @author : asus1020
 * @version : [v1.0]
 * @className : Result
 * @description : [描述说明该类的功能]
 * @createTime : [2022/3/20 18:23]
 * @updateUser : asus1020
 * @updateTime : [2022/3/20 18:23]
 * @updateRemark : [描述说明本次修改内容]
 */
@Data
public class Result {
    private Integer status;
    private String message;
    private Object data;

    public static  Result success(Object data){
        Result result = new Result();
        result.setStatus(200);
        result.setData(data);
        return result;
    }
    public static Result fail(String message){
        Result result = new Result();
        result.setStatus(400);
        result.setMessage(message);
        return result;
    }
    public Result() {
    }

    public Result(Integer status, Object data) {
        this.status = status;
        this.data = data;
    }

    public Result(Integer status, String message) {
        this.status = status;
        this.message = message;
    }

    public Result(Integer status, String message, Object data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }
}
